import _axios from '@/base/request/nlAxios.js'


 /**
 * 请求服务端比较用户办理业务的身份证和读证设备读取的身份证号是否一致
 * telnum 用户手机号
 * readSfzId 设备读取的身份证号
*/
 const checkUserSfzId = (telnum,readSfzId)=>{
    let url = '/xsb/personBusiness/personInfo/h5checkUsercust'
    let param = {
        telnum:telnum,//--用户手机号
        idcard:readSfzId//设备读取的身份证号
    }
    return _axios.post(url,param)
 }

/**
  * 查询权限开关
  * busiType 业务类型
 */
const qryBusiPermission = (busiType,axios)=>{
  let url = '/xsb/ability/businessLimit/h5QryBusiPermission'
  let param = {
    busiType,
    unLoadFlg:true
  }
  return axios.post(url,param)
}

/**
 * 查询ZK配置
 * @param {服务名} key 
 * @param {类型} itemKey 
 * @returns 
 */
const qryConfigByFeature = (key,itemKey)=>{
  let url = `/xsb/chatTools/dyconfig/h5get?key=${key}`;
  if(itemKey){
    url += `&itemKey=${itemKey}`;
  }
  return _axios.get(url);
}


/**
 * 解析语音
 * @returns 
 */
const getHttpVoiceTxt = (audioData)=>{
  let url = 'api/ai/v2t';
  let param = {
    audioData : audioData,
    unEncrpt : true
  }
  return _axios.post(url,param);
}

export {checkUserSfzId,qryBusiPermission,qryConfigByFeature,getHttpVoiceTxt}
